package com.three.controller;

import com.three.aop.LogAnotation;
import com.three.service.MenuService;
import com.three.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/menu")
public class MenuController {
    @Autowired
    private MenuService menuService;
    @GetMapping("/leftMenu")
    public R getLeftMenu()
    {
        menuService.getMenuByStaffId();
        return menuService.getMenuByStaffId();
    }
    //根据角色id获取菜单
    @GetMapping("/selectByRoleId")
    public R selectByRoleId( Integer roleid)
    {
        return menuService.selectByRoleId(roleid);
    }

    //确认修改角色权限
    @PostMapping("/updateRoleMenu")
    @LogAnotation(value = "修改角色权限")
    public R updateRoleMenu(Integer roleid,Integer[] checkedKeys)
    {
        return menuService.updateRoleMenu(roleid, checkedKeys);
    }
}
